<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
   
        <ui:define name="content">
            <h:outputScript name="jsf.js" library="javax.faces" target="head" />
             
            <h:panelGroup id="messagePanel" layout="block">
<!--                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>-->
            </h:panelGroup>
            <h:form>
                <p:panel toggleable="true" id="salesForecastAnalysis" header=" #{salesForecastEntityController.selected.yearOfSales-1} #{salesForecastEntityController.selected.monthOfSales} Sales Analysis">
                <h:panelGrid columns="2">
                      
                    <h:outputLabel value="Total Sales (Shipping Cases):" for="prevYear" />
                    <h:outputLabel value="#{salesForecastEntityController.selected.previousYearSales}"/>
                    
                    <h:outputLabel value=" Promotions Sales (Shipping Cases):" for="prevYearPromotion" />
                    <h:outputLabel value="#{salesForecastEntityController.selected.previousPromoSales}" />
                    
                    <h:outputLabel value=" Base Sales (Shipping Cases):" for="prevYearBase" />
                    <h:outputLabel  value="#{salesForecastEntityController.selected.previousYearBase}" />
             
                </h:panelGrid>
                </p:panel>
                     <br/>
                     
            
                     
              
                 <p:panel toggleable="true" id="breakdown" header="Sales BreakDown">
                     <h:panelGroup>
                         
                         <p:dataTable value="#{salesForecastEntityController.selected.historicalPPQ}" var="item" style="table-layout:fixed">
                         <p:column >
                                <f:facet name="header">
                                    <h:outputText value="Product Name : "/>
                                </f:facet>
                                <h:outputText value="#{item.product.productName}"/>
                            </p:column>  
                              <p:column >
                                <f:facet name="header">
                                    <h:outputText value="Percentage (%): "/>
                                </f:facet>
                                <h:outputText value="#{item.percentage*100}"/>
                            </p:column> 
                             <p:column >
                                <f:facet name="header">
                                    <h:outputText value="Quantity (Shipping Cases) : "/>
                                </f:facet>
                                <h:outputText value="#{item.quantity}"/>
                            </p:column> 
                         
                         
                         </p:dataTable>
                         
                         <p:pieChart model="#{salesForecastEntityController.pieModel}"/>
                                      
                     </h:panelGroup>
                    
                  
                     </p:panel>
                     
                      
               
               <h:commandButton value="Back" action="View"/>
                    
            </h:form>
            
        </ui:define>
    </ui:composition>

</html>
